package org.gpslw.controller;


import org.gpslw.entity.NycStreets;
import org.gpslw.repository.NycStreetsRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/hibernate")
public class HibernateSpatialController {

    @Autowired
    private NycStreetsRepository nycStreetsRepository;



    /**
     * 使用spring data jpa  + hibernate spatial查询
     * @return
     */
    @GetMapping("/list")
    public List<NycStreets> index() {
        List<NycStreets> all = nycStreetsRepository.findAll();
        return all;
    }




}
